package com.leon.rose.modules.upms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.leon.rose.modules.upms.entity.SysUser;
import com.leon.rose.modules.upms.mapper.SysUserMapper;
import com.leon.rose.modules.upms.service.ISysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 系统用户 服务实现类
 * </p>
 *
 * @author Leon
 * @since 2019-05-05
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {

  @Override
  public SysUser getUserByUsername(String username) {
    if (StringUtils.isBlank(username)){
      return null;
    }
    QueryWrapper qw = new QueryWrapper<>();
    qw.eq("user_name",username);
    return baseMapper.selectOne(qw);
  }
}
